'use strict';
/**
 * 元素是否在视口中
 * @param {object} elem 
 */
export function onview(elem) {
    if (!elem.getBoundingClientRect) {
        return false;
    }
    const rect = elem.getBoundingClientRect();

    return rect.top >= 0 && rect.left >= 0 && rect.top <= (window.innerHeight || document.documentElement.clientHeight);
}
